/* position.cpp */

#include <dodo_plot/kernel/position.h>
#include <dodo_plot/kernel/point.h>
#include <algorithm>

namespace dodo_plot
{

Position::Position() :
	left(0), right(0), top(0), bottom(0)
{ }

Position::Position(double l, double r, double t, double b) :
	left(l), right(r), top(t), bottom(b)
{ }

Position::Position(const Point& p1, const Point& p2)
{
	left = std::min(p1.x, p2.x);
	right = std::max(p1.x, p2.x);
	top = std::min(p1.y, p2.y);
	bottom = std::max(p1.y, p2.y);
}

}
